package com.java1234.util;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DButil {
	String drivername="com.microsoft.sqlserver.jdbc.SQLServerDriver";
	String url="jdbc:sqlserver://localhost:1433;DatabaseName=MeetingRoom";
	String username="sa";
	String userpsd="1234";
	public Connection getcon() throws ClassNotFoundException, SQLException {
		Class.forName(drivername);
		Connection dbConn=DriverManager.getConnection(url,username,userpsd);
		return dbConn;
	}
	public void closecon(Connection conn) throws SQLException
	{
		if(conn!=null)
			conn.close();
	}
}
